package com.sj.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.nio.Buffer;

/**
 * Created with IntelliJ IDEA.
 * User: xiaoqi
 * Date: 2022-07-07
 * Time: 上午 10:48
 * Description: 协议
 *
 * @author xiaoqi
 * @since 2022-07-07
 */
@Data
@ToString
public abstract class Protocol implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 消息头
     */
    private Header header;

    /**
     * 消息内容
     */
    private String content;


    public Protocol() {

    }

    public abstract Protocol getProtocol(MsgTypeEnum msgType, String msg);

    public abstract Protocol getProtocol(byte msgType, String msg);

}
